initDatePlugin();
/**
 * 绑定时间控件
 */
function initDatePlugin() {
    var intentionalTime = laydate.render({
        elem: '#intentionalTime'
    });
}


function intentionalCompany_update(){
    var id = $("#id").val();
    var companyName = $("#companyName").val();
    var address = $("#address").val();
    var contacts = $("#contacts").val();
    var type = $("#type").val();
    var telePhone = $("#telePhone").val();
    var mobilePhone = $("#mobilePhone").val();

    var smallType = $("#smallType").val();
    var position = $("#position").val();
    var staffNumber = $("#staffNumber").val();
    var describes = $("#describes").val();
    var intentionalTime = $("#intentionalTime").val();
    alert(intentionalTime);



    if (companyName == ""){
        swal({
            title: "填写有误",
            text: "企业名称不能为空"
        });
        return false;
    }

    $.ajax({
        url : "/intentionalCompany/intentionalCompany_update",
        type : "POST",
        traditional : true,
        dataType : "JSON",
        data : {
            id : id,
            companyName : companyName,
            address : address,
            contacts : contacts,
            type : type,
            telePhone : telePhone,
            mobilePhone : mobilePhone,
            smallType : smallType,
            position : position,
            staffNumber : staffNumber,
            describes : describes,
            intentionalTime : intentionalTime
        },
        success : function(data) {
            swal({
                title: "修改意向企业信息",
                text: "修改成功"
            }, function () {
                parent.layer.close(window.parent.intentionalCompany.layerIndex);
            });
            window.parent.intentionalCompany.table.refresh();
        },error : function () {
            swal({
                title: "修改意向企业信息",
                text: "修改失败"
            });
        }
    });
}

function cancel() {
    parent.layer.close(window.parent.intentionalCompany.layerIndex);
}